/*
 * Copyright 2014-2017 Eduard Ereza Martínez
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 *
 * You may obtain a copy of the License at
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cat.ereza.customactivityoncrash.provider;

import ohos.aafwk.ability.Ability;
import ohos.aafwk.content.Intent;
import ohos.data.dataability.DataAbilityPredicates;
import ohos.data.rdb.ValuesBucket;
import ohos.data.resultset.ResultSet;
import ohos.utils.net.Uri;

import cat.ereza.customactivityoncrash.CustomActivityOnCrash;
import cat.ereza.customactivityoncrash.LogUtil;
import cat.ereza.customactivityoncrash.annotations.NonNull;
import cat.ereza.customactivityoncrash.annotations.Nullable;

/**
 * CustomActivityOnCrash Provider class.
 * This will install the custom ability class to launch on app crash.
 */
public class CaocInitProvider extends Ability {
    private static final String TAG = "CaocInitProvider";

    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        LogUtil.info(TAG, "onStart()");
        CustomActivityOnCrash.install(this);
    }

    @Nullable
    @Override
    public ResultSet query(@NonNull Uri uri, @Nullable String[] columns, @Nullable DataAbilityPredicates predicates) {
        return null;
    }

    @Nullable
    @Override
    public String getType(@NonNull Uri uri) {
        return null;
    }

    @Override
    public int insert(@NonNull Uri uri, @Nullable ValuesBucket values) {
        return 0;
    }

    @Override
    public int delete(@NonNull Uri uri, @Nullable DataAbilityPredicates predicates) {
        return 0;
    }

    @Override
    public int update(@NonNull Uri uri, @Nullable ValuesBucket values, @Nullable DataAbilityPredicates predicates) {
        return 0;
    }
}
